package com.example.controller;

import com.example.service.ProviderService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhanglei
 * dubbo使用nacos
 */
@RestController
@RequestMapping("/client")
public class ClientController {


    @Reference(version = "1.0.0")
    private ProviderService dubboService;

    @GetMapping("/get")
    public String get(@RequestParam(name = "id", defaultValue = "") String id) {

        return dubboService.getService();
    }

}
